<!DOCTYPE HTML>
<html  xmlns:th="http://www.thymeleaf.org">
<head th:include="_meta :: header">
    <title>分配稿件</title>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row">
        <form class="layui-form form form-horizontal"  id="form-group-add" action="#" th:action="@{/distribute/draftCheckLeader/allot}">
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="x-red">*</span>分配校对人：</label>
                <div class="layui-input-inline">
<!--                    <input type="radio"  th:each="checker:${checkerList}"-->
<!--                           th:value="${checker.id}"  th:title="${checker.username}"-->
<!--                           class="layui-input"-->
<!--                           name="checker" />-->
                    <select id="checker" name="checker" class="layui-input">
                        <option
                                th:each="checker:${checkerList}"
                                th:value="${checker.id}"
                                th:text="${checker.username}"
                        ></option>
                    </select>
                    <!--<input name="roleId" type="radio"-->
                    <!--th:each="c:${writerList}"  th:value="${c.id}" th:text="${c.username}"/>-->
                    <!--<input type="layui-input" class="layui-input" t name="roleId"  placeholder="修改角色id" id="roleId"/>-->
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="x-red">*</span>分组名称：</label>
                <div class="layui-input-inline">
                    <div class="layui-input-inline">
                        <input type="layui-input" class="layui-input" t name="name"  placeholder="请输入分组名称" id="userId"/>
                    </div>
                </div>
            </div>

            <input id="draftId" type="hidden" name="draftId" th:value="${draftId}">
            <input id="ids" type="hidden" name="ids" th:value="${ids}">
            <input id="updateTime" type="hidden" name="updateTime" >
            <input id="createTime" type="hidden" name="createTime" >
            <div class="layui-form-item">
                <label style="width:120px" class="layui-form-label">
                </label>
                <button  class="layui-btn" id="subbtn" type="submit" >
                    分配
                </button>
            </div>
        </form>
    </div>
</div>

<!--_footer 作为公共模版分离出去-->
<div th:replace="_footer :: footerjs"></div>
<div th:replace="_ueditor :: ueditor"></div>
<!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script>
    layui.use(['form', 'layer','laydate'],function() {
        $ = layui.jquery;
        var form = layui.form,
                laydate = layui.laydate,
                layer = layui.layer;
        lay('.timeSpace').each(function(){
            laydate.render({
                elem: this
                ,trigger: 'click'
                ,type: 'datetime'
            });
        });
    });
    $(function(){
        $("#form-group-add").validate({
            rules:{
                checker:{
                    required: true,
                },
                name:{
                    required: true,
                },
                parentId:{
                    required: true,
                },
                updateTime:{
                    required: true,
                },
                createTime:{
                    required: true,
                },
            },
            onkeyup:false,
            debug: true,
            success:"valid",
            submitHandler:function(form){
//            var draftNum = UE.getEditor('editor').getContentTxt().length;
//            $("#draftNum").val(draftNum);
//            var curDate = new Date();
//            $("#createTime").val(curDate);
//            $("#updateTime").val(curDate);
                $.lock()
                $(form).ajaxSubmit({
                    type: 'POST',
                    url: "/distribute/draftCheckLeader/allot" ,
                    success: function(data){
                        if(data.code == "1"){
                            selfmsg('分配成功!',1,function(){
                                window.location.reload();
                                parent.location.reload();
                                parent.layer.close(index);
                            });
                        }else{
                            selfmsg(data.msg,null,null,2);
                            $.unlock();
                        }
                    },
                    error: function(){
                        selfmsg('分配异常!',5);
                        $.unlock();
                    }
                });
            }
        });
    });

</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>